Optimal. Leaf size=194 \[ -\frac{9 a^2 b \cos (c+d x)}{2 d}-\frac{3 a^2 b \cos (c+d x) \cot ^2(c+d x)}{2 d}+\frac{9 a^2 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a^3 \cot ^3(c+d x)}{3 d}+\frac{a^3 \cot (c+d x)}{d}+a^3 x-\frac{9 a b^2 \cot (c+d x)}{2 d}+\frac{3 a b^2 \cos ^2(c+d x) \cot (c+d x)}{2 d}-\frac{9}{2} a b^2 x+\frac{b^3 \cos ^3(c+d x)}{3 d}+\frac{b^3 \cos (c+d x)}{d}-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.183918, antiderivative size = 194, normalized size of antiderivative = 1., number of steps used = 17, number of rules used = 10, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.476, Rules used = {2722, 2592, 302, 206, 2591, 288, 321, 203, 3473, 8} \[ -\frac{9 a^2 b \cos (c+d x)}{2 d}-\frac{3 a^2 b \cos (c+d x) \cot ^2(c+d x)}{2 d}+\frac{9 a^2 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a^3 \cot ^3(c+d x)}{3 d}+\frac{a^3 \cot (c+d x)}{d}+a^3 x-\frac{9 a b^2 \cot (c+d x)}{2 d}+\frac{3 a b^2 \cos ^2(c+d x) \cot (c+d x)}{2 d}-\frac{9}{2} a b^2 x+\frac{b^3 \cos ^3(c+d x)}{3 d}+\frac{b^3 \cos (c+d x)}{d}-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 2592
Rule 302
Rule 206
Rule 2591
Rule 288
Rule 321
Rule 203
Rule 3473
Rule 8
Rubi steps
\begin{align*} \int \cot ^4(c+d x) (a+b \sin (c+d x))^3 \, dx &=\int \left (b^3 \cos ^3(c+d x) \cot (c+d x)+3 a b^2 \cos ^2(c+d x) \cot ^2(c+d x)+3 a^2 b \cos (c+d x) \cot ^3(c+d x)+a^3 \cot ^4(c+d x)\right ) \, dx\\ &=a^3 \int \cot ^4(c+d x) \, dx+\left (3 a^2 b\right ) \int \cos (c+d x) \cot ^3(c+d x) \, dx+\left (3 a b^2\right ) \int \cos ^2(c+d x) \cot ^2(c+d x) \, dx+b^3 \int \cos ^3(c+d x) \cot (c+d x) \, dx\\ &=-\frac{a^3 \cot ^3(c+d x)}{3 d}-a^3 \int \cot ^2(c+d x) \, dx-\frac{\left (3 a^2 b\right ) \operatorname{Subst}\left (\int \frac{x^4}{\left (1-x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{d}-\frac{\left (3 a b^2\right ) \operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{d}-\frac{b^3 \operatorname{Subst}\left (\int \frac{x^4}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac{a^3 \cot (c+d x)}{d}+\frac{3 a b^2 \cos ^2(c+d x) \cot (c+d x)}{2 d}-\frac{3 a^2 b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac{a^3 \cot ^3(c+d x)}{3 d}+a^3 \int 1 \, dx+\frac{\left (9 a^2 b\right ) \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{2 d}-\frac{\left (9 a b^2\right ) \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 d}-\frac{b^3 \operatorname{Subst}\left (\int \left (-1-x^2+\frac{1}{1-x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=a^3 x-\frac{9 a^2 b \cos (c+d x)}{2 d}+\frac{b^3 \cos (c+d x)}{d}+\frac{b^3 \cos ^3(c+d x)}{3 d}+\frac{a^3 \cot (c+d x)}{d}-\frac{9 a b^2 \cot (c+d x)}{2 d}+\frac{3 a b^2 \cos ^2(c+d x) \cot (c+d x)}{2 d}-\frac{3 a^2 b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac{a^3 \cot ^3(c+d x)}{3 d}+\frac{\left (9 a^2 b\right ) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{2 d}+\frac{\left (9 a b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 d}-\frac{b^3 \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=a^3 x-\frac{9}{2} a b^2 x+\frac{9 a^2 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac{9 a^2 b \cos (c+d x)}{2 d}+\frac{b^3 \cos (c+d x)}{d}+\frac{b^3 \cos ^3(c+d x)}{3 d}+\frac{a^3 \cot (c+d x)}{d}-\frac{9 a b^2 \cot (c+d x)}{2 d}+\frac{3 a b^2 \cos ^2(c+d x) \cot (c+d x)}{2 d}-\frac{3 a^2 b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac{a^3 \cot ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 6.23632, size = 355, normalized size = 1.83 \[ \frac{a \left (2 a^2-9 b^2\right ) (c+d x)}{2 d}+\frac{b \left (5 b^2-12 a^2\right ) \cos (c+d x)}{4 d}+\frac{\left (2 b^3-9 a^2 b\right ) \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{2 d}+\frac{\left (9 a^2 b-2 b^3\right ) \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{2 d}+\frac{\csc \left (\frac{1}{2} (c+d x)\right ) \left (4 a^3 \cos \left (\frac{1}{2} (c+d x)\right )-9 a b^2 \cos \left (\frac{1}{2} (c+d x)\right )\right )}{6 d}+\frac{\sec \left (\frac{1}{2} (c+d x)\right ) \left (9 a b^2 \sin \left (\frac{1}{2} (c+d x)\right )-4 a^3 \sin \left (\frac{1}{2} (c+d x)\right )\right )}{6 d}-\frac{3 a^2 b \csc ^2\left (\frac{1}{2} (c+d x)\right )}{8 d}+\frac{3 a^2 b \sec ^2\left (\frac{1}{2} (c+d x)\right )}{8 d}-\frac{a^3 \cot \left (\frac{1}{2} (c+d x)\right ) \csc ^2\left (\frac{1}{2} (c+d x)\right )}{24 d}+\frac{a^3 \tan \left (\frac{1}{2} (c+d x)\right ) \sec ^2\left (\frac{1}{2} (c+d x)\right )}{24 d}-\frac{3 a b^2 \sin (2 (c+d x))}{4 d}+\frac{b^3 \cos (3 (c+d x))}{12 d} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.062, size = 264, normalized size = 1.4 \begin{align*} -{\frac{{a}^{3} \left ( \cot \left ( dx+c \right ) \right ) ^{3}}{3\,d}}+{\frac{{a}^{3}\cot \left ( dx+c \right ) }{d}}+{a}^{3}x+{\frac{{a}^{3}c}{d}}-{\frac{3\,{a}^{2}b \left ( \cos \left ( dx+c \right ) \right ) ^{5}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}}}-{\frac{3\,{a}^{2}b \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{2\,d}}-{\frac{9\,{a}^{2}b\cos \left ( dx+c \right ) }{2\,d}}-{\frac{9\,{a}^{2}b\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}}-3\,{\frac{a{b}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{5}}{d\sin \left ( dx+c \right ) }}-3\,{\frac{a{b}^{2}\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{d}}-{\frac{9\,a{b}^{2}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}-{\frac{9\,a{b}^{2}x}{2}}-{\frac{9\,a{b}^{2}c}{2\,d}}+{\frac{{b}^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{3\,d}}+{\frac{{b}^{3}\cos \left ( dx+c \right ) }{d}}+{\frac{{b}^{3}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.21021, size = 252, normalized size = 1.3 \begin{align*} \frac{4 \,{\left (3 \, d x + 3 \, c + \frac{3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{3} - 18 \,{\left (3 \, d x + 3 \, c + \frac{3 \, \tan \left (d x + c\right )^{2} + 2}{\tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a b^{2} + 2 \,{\left (2 \, \cos \left (d x + c\right )^{3} + 6 \, \cos \left (d x + c\right ) - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} b^{3} + 9 \, a^{2} b{\left (\frac{2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - 4 \, \cos \left (d x + c\right ) + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.65166, size = 699, normalized size = 3.6 \begin{align*} \frac{18 \, a b^{2} \cos \left (d x + c\right )^{5} + 8 \,{\left (2 \, a^{3} - 9 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} - 3 \,{\left (9 \, a^{2} b - 2 \, b^{3} -{\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) + 3 \,{\left (9 \, a^{2} b - 2 \, b^{3} -{\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 6 \,{\left (2 \, a^{3} - 9 \, a b^{2}\right )} \cos \left (d x + c\right ) + 2 \,{\left (2 \, b^{3} \cos \left (d x + c\right )^{5} + 3 \,{\left (2 \, a^{3} - 9 \, a b^{2}\right )} d x \cos \left (d x + c\right )^{2} - 2 \,{\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{3} - 3 \,{\left (2 \, a^{3} - 9 \, a b^{2}\right )} d x + 3 \,{\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 2.6525, size = 568, normalized size = 2.93 \begin{align*} \frac{3 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 27 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 45 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 108 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 36 \,{\left (2 \, a^{3} - 9 \, a b^{2}\right )}{\left (d x + c\right )} - 36 \,{\left (9 \, a^{2} b - 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + \frac{198 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{9} - 44 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{9} + 45 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{8} + 108 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{8} + 135 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} + 156 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} + 132 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} - 324 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} - 351 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 156 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 126 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 540 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 315 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 148 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 36 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 108 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 27 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 3 \, a^{3}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}^{3}}}{72 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]